

export const transObj = (name)=>{
    let token = sessionStorage.getItem(name)
    try{
        token = JSON.parse(token)
        return token
    }catch{
        return token
    }
}

export const transStr = (name,payload)=>{
    if(typeof(payload) == 'object'){
        payload = JSON.stringify(payload)
    }
    sessionStorage.setItem(name,payload)
}

export const rmInfo =(state,name)=>{
    state[name] = null;
    sessionStorage.removeItem(name)
}